 (function(){
 "use strict";
 /**
 * zhx.multiCTC Template
 *
 * Author : Vicco Wang
 * Date : 05/04/2017
 *
 */
var ctcTemplate = angular.module('zhx.multi.ctc.template',[]);

ctcTemplate.run(['$templateCache',function($templateCache){

    //父模板
    $templateCache.put('zhx.multi.ctc.tpl.vicco',
        '<div id="zhx-multi-ctc-wrapper">' +
            '<div id="zhx-multi-ctc-controller">' +
                '<ul class="bus-icon">' +
                    '<li><span class="icon-normal"></span><span>正常</span></li>' +
                    '<li><span class="icon-stationing"></span><span>进站</span></li>' +
                    '<li><span class="icon-fullLoad"></span><span>满载</span></li>' +
                    '<li><span class="icon-alarm"></span><span>报警</span></li>' +
                    '<li><span class="icon-speeding"></span><span>超速</span></li>' +
                '</ul>' +
                '<ul class="bus-ctrl">' +
                    '<li class="multi-icon-font icon-editor-column" ng-click="columnScreen();"></li>' +
                '</ul>' +
            '</div>' +
            '<div id="zhx-multi-ctc-section-wrapper">' +
                '<div class="ctc-section-wrapper" id="multi-left-section" ng-model="ctcArray.western" ui-sortable="sortOptions">' +
                    '<div class="ctc-section" ng-style="{ height : ctcSectionHeight }" ng-repeat="ctc in ctcArray.western track by ctc[lineKeyMap.lineIdKey]">' +
                        '<sub-ctc options="ctc"></sub-ctc>' +
                    '</div>' +
                '</div>' +
            '<div id="multi-drag-handle" ng-if="isColumnScreen"></div>' +
                '<div class="ctc-section-wrapper" ng-show="isColumnScreen" id="multi-right-section" ng-model="ctcArray.eastern" ui-sortable="sortOptions">' +
                    '<div class="ctc-section"  ng-style="{ height : ctcSectionHeight }" ng-repeat="ctc in ctcArray.eastern track by ctc[lineKeyMap.lineIdKey]">' +
                        '<sub-ctc options="ctc"></sub-ctc>' +
                    '</div>' +
                '</div>' +
            '</div>' +
        '</div>');

    //直线图指令模板
    $templateCache.put('zhx.multi.subCtc.tpl.vicco',
        '<div class="multiSubCtcWrapper">'+
            '<div class="ctc-header">' +
                '<div class="ctc-line-name" ng-bind="lineName"></div>' +
                '<div class="ctc-line-info">' +
                    '<ul>' +
                        '<li><span>车辆</span><span>20</span></li>' +
                        '<li><span>配车</span><span>20</span></li>' +
                        '<li><span>上行</span><span ng-bind="busAttribution.upLineBus.length"></span></li>' +
                        '<li><span>下行</span><span ng-bind="busAttribution.downLineBus.length"></span></li>' +
                    '</ul>' +
                '</div>' +
                '<div class="ctc-bus-info">' +
                    '<ul>' +
                        '<li class="up-standby" context-menu="stateMenuOptions(\'upReadyBus\')" context-menu-on="click"  ' +
                            ' ng-class="{ pointerCursor : busAttribution.upReadyBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">上行待发</span>' +
                                '<span ng-bind="busAttribution.upReadyBus.length"></span>' +
                        '</li>' +
                        '<li class="up-nonServ" context-menu="stateMenuOptions(\'upNonServiceBus\')" context-menu-on="click" ' +
                            ' ng-class="{ pointerCursor : busAttribution.upNonServiceBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">上行非运营</span>' +
                                '<span ng-bind="busAttribution.upNonServiceBus.length"></span>' +
                        '</li>' +
                        '<li class="down-standby" context-menu="stateMenuOptions(\'downReadyBus\')" context-menu-on="click" ' +
                            ' ng-class="{ pointerCursor : busAttribution.downReadyBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">下行待发</span>' +
                                '<span ng-bind="busAttribution.downReadyBus.length"></span>' +
                        '</li>' +
                        '<li class="down-nonServ" context-menu="stateMenuOptions(\'downNonServiceBus\')" context-menu-on="click" ' +
                            ' ng-class="{ pointerCursor : busAttribution.downNonServiceBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">下行非运营</span>' +
                                '<span ng-bind="busAttribution.downNonServiceBus.length"></span>' +
                        '</li>' +
                        '<li class="off-line" context-menu="stateMenuOptions(\'offLineBus\')" context-menu-on="click" ' +
                            ' ng-class="{ pointerCursor : busAttribution.offLineBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">离线</span>' +
                                '<span ng-bind="busAttribution.offLineBus.length"></span>' +
                        '</li>' +
                        '<li class="stopServ" context-menu="stateMenuOptions(\'stopServiceBus\')" context-menu-on="click" ' +
                            ' ng-class="{ pointerCursor : busAttribution.stopServiceBus.length }">' +
                                '<span class="info-title" ng-if="!columnScreenState">停运</span>' +
                                '<span ng-bind="busAttribution.stopServiceBus.length"></span>' +
                        '</li>' +
                    '</ul>' +
                '</div>' +
                '<div class="ctc-line-ctrl" ng-class="{ snapRight : !columnScreenState }">' +
                    '<ul>' +
                        '<li class="multi-icon-font icon-jian" ng-click="fullScreenCTC($event);"></li>' +
                    '</ul>' +
                '</div>'+
            '</div>'+
            '<div class="ctc-main">' +
                '<div class="ctc-linearMap-wrapper">' +
                    //上行
                    '<div class="ctc-linearMap-up-line line-left">' +
                        //上行车辆
                        '<ul class="ctc-linear-bus">' +
                            '<li ng-repeat="bus in busAttribution.upLineBus track by bus[busKeyMap.busIdKey]"' +
                            ' context-menu="busMenuOptions" ' +
                            ' context-menu-add-callback="busMenuAddCallback" context-menu-remove-callback="busMenuRemoveCallback" ' +
                            ' ng-click="showBusInfo($event,bus)" '+
                            ' ng-style="{ left: bus.__relativePos , top : bus.__relativeTop }"></li>' +
                        '</ul>' +
                        //上行线路站点
                        '<ul class="ctc-linear-line">' +
                            '<li ng-repeat="station in upStationList track by station[lineKeyMap.stationIdKey]" ' +
                                'ng-style="{ left : station.__relativePos }">' +
                                '<span class="ctc-linearMap-station-name up-station-name" ng-bind="station[lineKeyMap.stationNameKey]"></span>' +
                            '</li>' +
                        '</ul>' +
                    '</div>' +
                    //下行
                    '<div class="ctc-linearMap-down-line line-right">' +
                        //下行车辆
                        '<ul class="ctc-linear-bus">' +
                            '<li ng-repeat="bus in busAttribution.downLineBus track by bus[busKeyMap.busIdKey]"' +
                            ' context-menu="busMenuOptions" ' +
                            ' context-menu-add-callback="busMenuAddCallback" context-menu-remove-callback="busMenuRemoveCallback" ' +
                            ' ng-click="showBusInfo($event,bus)" '+
                            ' ng-style="{ right: bus.__relativePos , top : bus.__relativeTop }"></li>' +
                        '</ul>' +
                        //下行线路站点
                        '<ul class="ctc-linear-line">' +
                            '<li ng-repeat="station in downStationList track by station[lineKeyMap.stationIdKey]" ' +
                            'ng-style="{ right : station.__relativePos }">' +
                                '<span class="ctc-linearMap-station-name down-station-name" ng-bind="station[lineKeyMap.stationNameKey]"></span>' +
                            '</li>' +
                        '</ul>' +
                    '</div>' +
                '</div>' +
            '</div>'+
        '</div>');

    /**
     * 车辆悬停模板
     */
    $templateCache.put('zhx.ctc.bus.info.tpl.vicco',
        '<div class="control-context-menu">'+
            '<div class="bus-no"><span>{{ bus[ busKeyMap.busNoKey ] }}</span></div>' +
            '<ul>' +
                '<li>当前司机：李达康</li>' +
                '<li>报警：暂无</li>' +
                '<li>实时位置：XXXX</li>' +
                '<li>离线时间：2017-10-10 05:29:59</li>' +
                '<li>持续时间：2017-10-10</li>' +
                '<li>车辆班次：3</li>' +
                '<li>下一趟次：2017-10-10 05:29:59</li>' +
                '<li>发车时间：2017-10-10 10:10:10</li>' +
            '</ul>' +
        '</div>');

}]);
 
})(); 